<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0,  maximum-scale=1.0" />
		<meta name="format-detection" content="telephone=no" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<meta content="black" name="apple-mobile-web-app-status-bar-style" />
		<link rel="stylesheet" type="text/css" href="${ctxStatic}/shopcartstatic/css/public.css"  />
		<link rel="stylesheet" type="text/css" href="${ctxStatic}/shopcartstatic/css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="${ctxStatic}/shopcartstatic/css/mistiming/mistiming.css"/>

	</head>

	<body id="body ">
	<div class="tip-info" style="display:none;"><span id="loginError"></span></div>
		<div class="home ">
			<!-- 轮播图 -->
			<div id="lunbo ">

			</div>

			<!-- 一级菜单-->
			<div class="g_nav">
			<ul class="clearfix">
				<c:forEach items="${categorylist}" var="c">
				<li>
					<a href="../client/mistiming?index=1&categoryid=${c.id}">
						<img src="${c.icon}" alt="">
						<p>${c.name}</p>
					</a>
				</li>
				</c:forEach>

			</ul>
			<!--<div class="nav_bg"><img src="images/nav_img.jpg" alt="" width="100%"></div>-->
		</div>
			<!-- 内容 -->
			<div style="width: 100%;height:auto; border-top:20px solid #e5e5e5;"></div>
						<div  style="width: 100%;height:40px; ">
							<div style="width:10%;float: left;margin-left:3%; ">
								<%--<img alt=" " src=" "style="display: inline-block; width: 1.8em; height: 1.8em; ">--%>
							</div>
							<div style="width:85%;float: right;padding-top:5px; ">
								<span  style="float: left; "></span>

								<span style="float: right;margin-right:3%; "><a style="color:#666; " href="menupage?cid=${cid}">更多&nbsp;></a></span>

							</div>
						</div>
							<div class="tuan_div">
					<div class="tuan_div1">
						<c:forEach begin="0" end="2" items="${productlist}" var="p">
						<a href="easyLifedetails?productid=${p.id} ">
							<div class="tuan_div2">
								<img src="${p.imgList[0]}">
							</div>
						</a>
							<div class="tuan_div3">
								<a href="easyLifedetails?productid=${p.id} ">
								<span class="tuan_div3_sp">${p.name}</span>
								<span class="tuan_div3_sp1">
								<img alt="" src="${ctxStatic}/shopcartstatic/images/location.png">
								距离：100km</span>
								</a>
								<span class="tuan_div3_sp2">
									简单 简约 绿色 温馨
									 <c:if test="${p.bool==0}">
                                        <img alt="" src="${ctxStatic}/shopcartstatic/images/collectionselect.png"
											 onclick="changeimg('${p.id}',this)">
									 </c:if>
                                    <c:if test="${p.bool==1}">
                                        <img alt="" src="${ctxStatic}/shopcartstatic/images/collectionselected.png"
											 onclick="changeimg('${p.id}',this)">
									</c:if>

								</span>
								<a href="easyLifedetails?productid=${p.id} ">
								<span class="tuan_div3_sp3" >|</span>&nbsp;&nbsp;店铺：${p.sellshop} </span>
								</a>
							</div>


						<div style="width:100%;height:10px;float:left;"></div>
						</c:forEach>
					</div>

					<div class="h_div1"></div>

				</div>

			<!--底部导航栏 -->
		<div class="nav" id="tabbar"></div>
	
		<script src="${ctxStatic}/shopcartstatic/js/jquery-1.6.2.min.js "></script>
		<script type="text/javascript "  src="${ctxStatic}/shopcartstatic/js/public.js "></script>
		<script type="text/javascript ">
		$(function(){
			document.getElementById('mistiming').setAttribute("src","${ctxStatic}/shopcartstatic/images/3.3.png");
		})
		</script>
		<script>

			var $message = '${message}';
			if ($message != null && $message != '') {
				$(".tip-info").show();
				setTimeout(function () {
					$(".tip-info").hide();
				}, 3000);
			}
			function changeimg(id,bb) {

				if (bb.src.indexOf('ed')>=0){
					//取消收藏
					$("#loginError").html("取消收藏成功");
					$(".tip-info").show();
					setTimeout(function () {
						$(".tip-info").hide();
					}, 2000);
					bb.src="${ctxStatic}/shopcartstatic/images/collectionselect.png"
					window.location.href="/shop/client/collectionsdel2?id="+id;
				} else {
					//收藏成功
					$("#loginError").html("收藏成功")
					$(".tip-info").show();
					setTimeout(function () {
						$(".tip-info").hide();
					}, 2000);
					bb.src="${ctxStatic}/shopcartstatic/images/collectionselected.png";
					window.location.href="/shop/client/collectionsadd?id="+id;
				}
			}
		</script>

		</div>
	</body>


</html>